package com.es.service.impl;

import com.es.JDBCUtils;
import com.es.dao.BankAccountDaoI;
import com.es.dao.impl.BankAccountDaoImpl;
import com.es.entity.BankAccount;
import com.es.service.BankAccountService;

import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class BankAccountServiceImpl implements BankAccountService {

    BankAccountDaoI dao = new BankAccountDaoImpl();

    @Override
    public BankAccount get(String cardNo) {
        return dao.get(cardNo);
    }

    @Override
    public int save(BankAccount bankAccount) {

        return dao.save(bankAccount);
    }

    @Override
    public int withdraw(String cardNo, BigDecimal amount) {
        return dao.withdraw(cardNo, amount);
    }

    @Override
    public int deposit(String cardNo, BigDecimal amount) {
        return 0;
    }

    @Override
    public int trans(String from, String to, BigDecimal amount) {
        return dao.trans(from, to, amount);
    }
}
